/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bash.jcouture.util.swing;


import com.bash.compta.data.Compte;
import com.bash.compta.db4o.DBTool;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;

/**
 *
 * @author bashizip
 */
public class ComptesListModel implements ListModel{

 List<Compte> elts;

    public ComptesListModel() {
     
            elts = DBTool.getInstance().db.query(Compte.class);
        
    }

public ComptesListModel( List<Compte> elts) {
      
            this.elts = elts;
       
    }

    public int getSize() {
       return elts.size();
    }

    public Object getElementAt(int index) {
      return elts.get(index).getLittera()+"."+elts.get(index).getLibelle();
    }

    public void addListDataListener(ListDataListener l) {
       
    }

    public void removeListDataListener(ListDataListener l) {
      
    }

}
